package com.smart.comp;

import com.smart.main.Principal;
import com.smart.vista.panel.ArticulosVista;
import com.smart.vista.panel.GuiasSoporteVista;
import com.smart.vista.panel.GuiasAlmacenVista;
import javax.swing.JOptionPane;
import javax.swing.JToolBar;

public class ToolBarSoporte extends JToolBar {

    public ToolBarSoporte() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnGuiasSoporte = new javax.swing.JButton();
        btnArticulos = new javax.swing.JButton();
        btnGuias = new javax.swing.JButton();
        btnCerrarSistema = new javax.swing.JButton();

        setFloatable(false);

        btnGuiasSoporte.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/smart/recursos/informe.png"))); // NOI18N
        btnGuiasSoporte.setToolTipText("Guias de Soporte Tecnico");
        btnGuiasSoporte.setFocusable(false);
        btnGuiasSoporte.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnGuiasSoporte.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnGuiasSoporte.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuiasSoporteActionPerformed(evt);
            }
        });
        add(btnGuiasSoporte);

        btnArticulos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/smart/recursos/devices.png"))); // NOI18N
        btnArticulos.setToolTipText("Articulos");
        btnArticulos.setFocusable(false);
        btnArticulos.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnArticulos.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnArticulos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnArticulosActionPerformed(evt);
            }
        });
        add(btnArticulos);

        btnGuias.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/smart/recursos/mas.png"))); // NOI18N
        btnGuias.setToolTipText("Guias de Almacen");
        btnGuias.setFocusable(false);
        btnGuias.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnGuias.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnGuias.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuiasActionPerformed(evt);
            }
        });
        add(btnGuias);

        btnCerrarSistema.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/smart/recursos/exit.png"))); // NOI18N
        btnCerrarSistema.setToolTipText("Cerrar Sistema");
        btnCerrarSistema.setFocusable(false);
        btnCerrarSistema.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnCerrarSistema.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnCerrarSistema.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCerrarSistemaActionPerformed(evt);
            }
        });
        add(btnCerrarSistema);
    }// </editor-fold>//GEN-END:initComponents

    private void btnGuiasSoporteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuiasSoporteActionPerformed
        GuiasSoporteVista panel = new GuiasSoporteVista();
        Principal.agregarTab(panel, Principal.arrTitulosPaneles[0]);
    }//GEN-LAST:event_btnGuiasSoporteActionPerformed

    private void btnArticulosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnArticulosActionPerformed
        ArticulosVista panel = new ArticulosVista();
        Principal.agregarTab(panel, Principal.arrTitulosPaneles[1]);
    }//GEN-LAST:event_btnArticulosActionPerformed

    private void btnCerrarSistemaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCerrarSistemaActionPerformed
        int rpta = JOptionPane.showConfirmDialog(null, "Esta seguro que desea cerrar el Sistema?", "Cerrando el Sistema", JOptionPane.YES_NO_OPTION);
        if (rpta == JOptionPane.YES_OPTION) {
            System.exit(0);
        }
    }//GEN-LAST:event_btnCerrarSistemaActionPerformed

    private void btnGuiasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuiasActionPerformed
        GuiasAlmacenVista panel = new GuiasAlmacenVista();
        Principal.agregarTab(panel, Principal.arrTitulosPaneles[2]);
    }//GEN-LAST:event_btnGuiasActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnArticulos;
    private javax.swing.JButton btnCerrarSistema;
    private javax.swing.JButton btnGuias;
    private javax.swing.JButton btnGuiasSoporte;
    // End of variables declaration//GEN-END:variables
}
